package com.my.house.common;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * @author yangll
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class PageRequest {

    @NotNull(message = "{api.page.error.isNull}")
    @Min(value = 1, message = "{api.page.error.min}")
    private int pageNum;

    @NotNull(message = "{api.page.error.size.isNull}")
    @Min(value = 1, message = "{api.page.error.size.min}")
    private int pageSize;

    public void init() {
        this.pageNum = 1;
        this.pageSize = 10;
    }

}
